package com.wlf.spring;

import org.springframework.context.support.GenericApplicationContext;

import java.io.IOException;

public class Application {
    public static void main(String[] args) throws IOException {
        GenericApplicationContext context = new GenericApplicationContext();
        context.registerBean("config",Config.class);
        //context.registerBean(ConfigurationClassPostProcessor.class);
        //ConfigurationClassPostProcessor 解析@ComponentScan @Bean @Import @ImportResource
        //context.registerBean(MapperScannerConfigurer.class);

        //自定义后处理器
        //context.registerBean(ComponentScanPostProcessor.class);
        //context.registerBean(AtBeanPostProcessor.class);
        context.registerBean(MapperBeanPostProcessor.class);


        context.refresh();

        for (String beanDefinitionName : context.getBeanDefinitionNames()) {
            System.out.println(beanDefinitionName);
        }

        context.close();
    }
}
